<div id="container">
Before <span id="sample" style="font-family: monospace; -webkit-user-select:none">Test</span> After
</div>
<script src="../../../../resources/js-test.js"></script>
<script>
function $(id) { return document.getElementById(id); }

var range = document.caretRangeFromPoint($('sample').offsetLeft + $('sample').offsetWidth / 2, $('sample').offsetTop + 3);
shouldBe('range.startContainer', '$("sample").firstChild');
shouldBe('range.startOffset', '2');
shouldBeTrue('range.collapsed');

if (window.testRunner)
    $('container').outerHTML = '';
</script>
